package PTA.Mianxiangduixiang.ex43;

import java.util.Scanner;

class Line{
   private Point p1;
   private  Point p2;
    Line(){}
    public Line(Point p1,Point p2) {
        this.p1 = p1;
        this.p2 = p2;
    }
    public double getLength(){
        return p1.distance(p2);
    }

    public Point getP1() {
        return p1;
    }

    public void setP1(Point p1) {
        this.p1 = p1;
    }

    public Point getP2() {
        return p2;
    }

    public void setP2(Point p2) {
        this.p2 = p2;
    }

    public double getLength(int p1, int p2){
    return Math.sqrt(p1-p2);
}
    @Override
    public String toString() {
        return "Line [p1=" + p1 + ", p2=" + p2 + "]";
    }
}
 class Point {
    private int x, y;// x,y为点的坐标
    //求两点之间的距离
    public double distance(Point p1) {
        return Math.sqrt((p1.x -this.x)*(p1.x -this.x)+(p1.y-this.y)*(p1.y-this.y));
    }
    public Point(int x, int y) {
        super();
        this.x = x;
        this.y = y;
    }
    public int getX() {
        return x;
    }
    public void setX(int x) {
        this.x = x;
    }
    public int getY() {
        return y;
    }
    public void setY(int y) {
        this.y = y;
    }
    public Point() {
        super();
        x = y =0;
    }
    @Override
    public String toString() {
        return "Point [x=" + x + ", y=" + y + "]";
    }
}


public class ex43 {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int n = sc.nextInt();
        Line []line = new Line[n];
        for(int i=0;i<n;i++){
           Point p1 = new Point(sc.nextInt(),sc.nextInt());
           Point p2 = new Point(sc.nextInt(),sc.nextInt());
           line[i]=new Line(p1,p2);
        }
        for(int i = 0;i<n;i++){
            System.out.println(line[i].toString());
            System.out.printf("此线段的长度为：%.1f\n",line[i].getLength());
        }


    }
}
